﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Meeting.aspx.cs" Inherits="Meeting.Web.Admin.MeetingSet.Meeting" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>设置会议调查</title>
    <link rel="stylesheet" type="text/css" href="../../Scripts/themes/cupertino/easyui.css" />
    <link rel="stylesheet" type="text/css" href="../../Scripts/themes/icon.css" />
    <link rel="stylesheet" type="text/css" href="../../Css/main.css" />
    <script src="../../Scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../Scripts/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="../../Scripts/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../../Scripts/locale/easyui-lang-zh_CN.js"></script>
    <!--ardialog-->
    <script type="text/javascript" src="../../Scripts/artDialog4.1.6/artDialog.js?skin=blue"></script>
    <script type="text/javascript" src="../../Scripts/artDialog4.1.6/plugins/iframeTools.js"></script>
    <script type="text/javascript" src="../../Scripts/common.js"></script>
    <script type="text/javascript">

        $(function () {
            if (request("psnID") == "") window.location = defaultUrl;
            //初始化列表
            $('#mainList').datagrid({
                url: 'MeetingOperation.ashx?method=GetAllMeeting',
                singleSelect: true,
                collapsible: false,
                  pagination: true, //是否开启分页
                pageNumber: 1, //默认索引页
                pageSize: 20  //默认一页数据条数
            });
            //设置分页
            var p = $("#mainList").datagrid("getPager");
            $(p).pagination({
                pageSize: 20, //每页显示的记录条数，默认为10   
                pageList: [10, 20, 30], //可以设置每页记录条数的列表   
                beforePageText: '第', //页数文本框前显示的汉字   
                afterPageText: '页    共 {pages} 页',
                displayMsg: '当前显示 {from} - {to} 条记录   共 {total} 条记录'
            });
        });
        //
        function DoSearch() {
            $('#mainList').datagrid('reload', {
                Name: $("#fName").val(),

                Begin: $("#txtBeginTime").val(),
                End: $("#txtEndTime").val()
            });
        }

        
    </script>
    <style type="text/css">
        input
        {
            height: 18px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <table class="SearchTable">
        <tr>
            <td>
                名称:
            </td>
            <td>
                <input id="fName" style="width: 120px;" class="easyui-validatebox" />
            </td>
            <%--  <td>
                主持:
            </td>
            <td>
                <input type="hidden" id="HostId" />
                <input id="Host" type="text" class="easyui-validatebox" style="width: 120px" /><img
                    src="../../Images/Search.ico" onclick="GetMeetingHost();" alt="选择会议主持人" id="SelectHostId" />
            </td>--%>
            <td>
                开始时间:
            </td>
            <td>
                <input id="txtBeginTime" onfocus="WdatePicker({startDate:'%y-%M-01 00:00',dateFmt:'yyyy-MM-dd HH:mm',alwaysUseStartDate:true})"
                    style="width: 120px" />
            </td>
            <td>
                ~
            </td>
            <td>
                <input id="txtEndTime" onfocus="WdatePicker({startDate:'%y-%M-01 00:00',dateFmt:'yyyy-MM-dd HH:mm',alwaysUseStartDate:true})"
                    style="width: 120px" />
            </td>
            <td>
                <a href="#" class="easyui-linkbutton" onclick="DoSearch();">查询</a>
            </td>
        </tr>
    </table>
    <div style="min-height: 500px; text-align: left;">
        <table id="mainList" class="easyui-datagrid" style="width: 1150px;">
            <thead>
                <tr>
                    <th data-options="field:'Id',width:120,hidden:true">
                    </th>
                    <th data-options="field:'CategoryId',width:120,hidden:true">
                    </th>
                    <th data-options="field:'Name',width:120">
                        会议名称
                    </th>
                    <th data-options="field:'RoomName',width:80 ">
                        会议室
                    </th>
                    <th data-options="field:'StartDate',width:100 ">
                        开始时间
                    </th>
                    <th data-options="field:'EndDate',width:100">
                        预计结束时间
                    </th>
                    <th data-options="field:'HostName',width:60 ">
                        会议主持
                    </th>
                    <th data-options="field:'Status',width:60,formatter:formatStatus ">
                        会议状态
                    </th>
                    <th data-options="field:'actionColumn',width:80,formatter:formatMeetingInfo">
                        修改会议
                    </th>
                    <th data-options="field:'actionColumn1',width:80,formatter:formatMeetingEmployee">
                        设置参会人
                    </th>
                    <th data-options="field:'actionColumn2',width:70,formatter:formatMeetingTopic">
                        关联议题
                    </th>
                    <th data-options="field:'actionColumn3',width:70,formatter:formatMeetingDocument">
                        管理文档
                    </th>
                    <th data-options="field:'actionColumn7',width:70,formatter:formatMeetingPlate">
                        地块信息
                    </th>
                    <th data-options="field:'actionColumn4',width:70,formatter:formatMeetingVote">
                        设置投票
                    </th>
                    <th data-options="field:'actionColumn5',width:70,formatter:formatMeetingDelete">
                        删除会议
                    </th>
                </tr>
            </thead>
        </table>
        <script type="text/javascript">

            function OpenEdit(title, inUrl, param, width, height) {
                var wName;
                var radStr = Math.random();
                var url = inUrl + '?Radstr=' + radStr + param;
                art.dialog.open(url, { title: title,
                    id: 'AAAj', width: width, height: height, lock: true,
                    close: function () {
                        //                        var id = art.dialog.data('id'); // 读取人员选择返回值
                        //                        var name = art.dialog.data('name');
                        //                        $("#HostId").val(id);
                        //                        $("#Host").val(name);
                    }
                }, false);
            }

            function formatMeetingInfo(val, row) {
                if (row.Status == 3 || row.Status == 4) {
                    return "";
                }
                else {
                    return "<a href='#' class='easyui-linkbutton' onclick=\"EidtMeetingInfo('" + row.Id + "');\"  >修改会议信息</a> ";
                }
            }
            function EidtMeetingInfo(Id) {
                OpenEdit('修改会议信息', "MeetingInfo.aspx", "&Id=" + Id, 760, 400);
            }
            function formatMeetingEmployee(val, row) {
                if (row.Status == 3 || row.Status == 4) {
                    return "";
                }
                else {
                    return "<a href='#' class='easyui-linkbutton' onclick=\"EditMeetingEmployee('" + row.Id + "','" + row.Name + "','" + row.CategoryId + "');\"  >设置参会人员</a> ";
                }
            }
            function EditMeetingEmployee(id, name, categoryId) {
                var param = "&Id=" + id + "&Name=" + escape(name) + "&CategoryId=" + categoryId;
                OpenEdit('设置参会人员', "MeetingEmployee.aspx", param, 800, 500);
            }
            //设置议题关联
            function formatMeetingTopic(val, row) {
                if (row.Status == 3 || row.Status == 4) {
                    return "";
                }
                else {
                    return "<a href='#' class='easyui-linkbutton' onclick=\"EditMeetingTopic('" + row.Id + "','" + row.Name + "','" + row.CategoryId + "');\"  >关联议题</a> ";
                }
            }
            function EditMeetingTopic(id, name, categoryId) {
                var param = "&Id=" + id + "&Name=" + escape(name) + "&CategoryId=" + categoryId;
                OpenEdit('关联议题', "MeetingTopic.aspx", param, 800, 500);
            }
            //管理文档
            function formatMeetingDocument(val, row) {
                if (row.Status == 3 || row.Status == 4) {
                    return "";
                }
                else {
                    return "<a href='#' class='easyui-linkbutton' onclick=\"EditMeetingDocument('" + row.Id + "','" + row.Name + "','" + row.CategoryId + "');\"  >管理文档</a> ";
                }
            }
            function EditMeetingDocument(id, name, categoryId) {
                var param = "&Id=" + id + "&Name=" + escape(name) + "&CategoryId=" + categoryId;
                OpenEdit('管理文档', "MeetingDocument.aspx", param, 800, 480);
            }
            //管理地块
            function formatMeetingPlate(val, row) {
                if (row.Status == 3 || row.Status == 4) {
                    return "";
                }
                else {
                    return "<a href='#' class='easyui-linkbutton' onclick=\"EditMeetingPlate('" + row.Id + "','" + row.Name + "','" + row.CategoryId + "');\"  >地块信息</a> ";
                }
            }
            function EditMeetingPlate(id, name, categoryId) {
                var param = "&Id=" + id + "&Name=" + escape(name) + "&CategoryId=" + categoryId;
                OpenEdit('管理地块信息', "MeetingPlate.aspx", param, 800, 480);
            }

            //设置投票
            function formatMeetingVote(val, row) {
                if (row.Status == 3 || row.Status == 4) {
                    return "";
                }
                else {
                    return "<a href='#' class='easyui-linkbutton' onclick=\"EditMeetingVote('" + row.Id + "','" + row.Name + "','" + row.CategoryId + "');\"  >设置投票</a> ";
                }
            }
            function EditMeetingVote(id, name, categoryId) {
                var param = "&Id=" + id + "&Name=" + escape(name) + "&CategoryId=" + categoryId;
                OpenEdit('设置投票', "MeetingVote.aspx", param, 780, 400);
            }
            function formatMeetingDelete(val, row) {
                if (row.Status == 3 || row.Status == 4) {
                    return "";
                }
                else {
                    return "<a href='#' class='easyui-linkbutton' onclick=\"DeleteMeeting('" + row.Id + "');\"  >删除会议</a> ";
                }
            }
            function DeleteMeeting(id) {
                $.messager.confirm("询问", "该会议将被永久删除，确定吗？", function (c) {
                    if (!c) return;
                    var postData = { Id: id };
                    $.post("MeetingEditOperation.ashx?method=DeleteMeeting", postData, function (data) {
                        if (data.success == true) {
                            $.messager.alert("提示", "会议删除成功");
                            $("#mainList").datagrid("reload");
                        } else {
                            $.messager.alert("提示", "会议删除失败:" + data.Message);
                        }
                    });
                });
            }
            function formaFileUp(val, row) {
                return "<img src='../../Images/upload.gif' alt='' /> ";
            }
        </script>
    </div>
    </form>
</body>
</html>
